package com.alongstudio.account.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;


@Entity
@Table(name="tbl_keep_accounts_detail")
public class KeepAccountsDetail {
	@Id
	@Column(name = "id", length=32)
	@GeneratedValue(generator = "identityGenerator")
	@GenericGenerator(name = "identityGenerator", strategy = "com.alongstudio.account.commons.utils.IdentityGenerator")
	private String id;
	private String type;//I-收入，O-支出，T-转账，BI-借入，BO-借出，PD-还债，RD-收债
	private double amount;// 金额
	@Column(length=100)
	private String remark;// 备注
	@Column(name="to_amount")
	private double toAmount;//转入金额，用于转账
	@Column(name = "happened_date")
	private Date happenedDate;// 消费日期
	@Column(name = "create_time")
	private Date createTime;
	@Column(name = "update_time")
	private Date updateTime;
	@ManyToOne
	@JoinColumn(name = "fk_merchant_id")
	private Merchant merchant;// 商店
	@ManyToOne
	@JoinColumn(name = "fk_category_id")
	private Category category;// 分类
	@ManyToOne
	@JoinColumn(name = "fk_account_id")
	private Account account;// 账户类型：现金、信用卡等
	// private String isReimbursed;// 是否报销，0否，1是
	@ManyToOne
	@JoinColumn(name = "fk_project_id")
	private Project project;// 所属项目
	
	@ManyToOne
	@JoinColumn(name = "fk_client_user_id")
	private ClientUser clientUser;// 系统用户
	
	@ManyToOne
	@JoinColumn(name = "fk_to_account_id")
	private Account toAccount;//转入账户，用于转账

	
	public KeepAccountsDetail(){
		
	}
	public KeepAccountsDetail(String id){
		this.id = id;
	}
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public double getToAmount() {
		return toAmount;
	}

	public void setToAmount(double toAmount) {
		this.toAmount = toAmount;
	}

	public Account getToAccount() {
		return toAccount;
	}

	public void setToAccount(Account toAccount) {
		this.toAccount = toAccount;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Merchant getMerchant() {
		return merchant;
	}

	public void setMerchant(Merchant merchant) {
		this.merchant = merchant;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public ClientUser getClientUser() {
		return clientUser;
	}

	public void setClientUser(ClientUser clientUser) {
		this.clientUser = clientUser;
	}

	public double getAmount() {
		return amount;
	}

	public void setAmount(double amount) {
		this.amount = amount;
	}

	

	public Date getHappenedDate() {
		return happenedDate;
	}

	public void setHappenedDate(Date happenedDate) {
		this.happenedDate = happenedDate;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}


}
